import request from '@/utils/request'

// 文件上传
export function uploadImage(data) {
  return request({
    url: '/metadata/v1/file/image/base64/upload',
    method: 'post',
    data: data,
    timeout: 300000
  })
}

// 文件上传
export function uploadVideo(data) {
  return request({
    url: '/metadata/v1/file/media/upload',
    method: 'post',
    data: data,
    timeout: 300000
  })
}

// 获取七牛token
export function getQiniuToken() {
  return request({
    url: '/metadata/v1/file/token',
    method: 'get',
  })
}

// 删除文件
export function deleteFile(key) {
  return request({
    url: '/metadata/v1/file?key=' + key,
    method: 'delete',
  })
}

// 获取 light picture
export function getLightPictureToken() {
  return request({
    url: '/metadata/v1/file/light_picture/token',
    method: 'get',
  })
}
